<style scoped>
  @import "../../static/css/weui.css";
  @import "../../static/css/jquery-weui.min.css";
  /*@import "../../static/css/mobilestyle.css";*/
  .weui_cells:before {
    content: " ";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1px;
    border-top: 1px solid #D9D9D9;
    color: #D9D9D9;
  }
  .weui_cells_form .weui_cell_ft {
    transform: scale(0.7);
  }
  .weui_cells_access a.weui_cell {
    text-align: left;
  }
  .weui_cells_access .weui_cell_ft.hrf:after {
    border-color: #04be02;
  }
</style>
<template>
  <div id="app-main">
    <div class="weui-row weui-no-gutter" style="background-color: #ec623d;">
      <div class="weui-col-33" style="text-align:center;"><img src="@/assets/new_home_call.png" alt="" style="height:30px;margin:0px auto;margin-top:75px;display:block"/><label style="margin:0px auto;color: #fff;display:block">{{user.phonenumber}}</label></div>
      <div class="weui-col-33" style="text-align:center;height: 154px;"><img src="@/assets/avatar_img.png" alt="" style="height:60px;margin:0px auto;margin-top:40px;display:block"/><label style=";margin:0px auto;color: #fff;font-size: 20px;">{{user.nickName}}<span id="userType" style="display: block;font-size:12px;color:#fff;"></span></label></div>
      <div class="weui-col-33" style="text-align:center;"><img src="@/assets/icon-tag.png" alt="" style="height:30px;margin:0px auto;margin-top:75px;display:block"/><label style="margin:0px auto;color: #fff;display:block">{{user.userTypeName}}</label></div>
    </div>

  <div class="weui_cells weui_cells_access">
    <template v-if="user.userType == 1">
      <a class="weui_cell" href="javascript:;">
        <div class="weui_cell_bd weui_cell_primary">
          <p>户名</p>
        </div>
        <div class="weui_cell_ft">{{user.supplier.name}}</div>
      </a>
      <a class="weui_cell" href="javascript:;">
        <div class="weui_cell_bd weui_cell_primary">
          <p>开户行</p>
        </div>
        <div class="weui_cell_ft">{{user.supplier.bank}}</div>
      </a>
      <a class="weui_cell" href="javascript:;">
        <div class="weui_cell_bd weui_cell_primary">
          <p>银行账号</p>
        </div>
        <div class="weui_cell_ft">{{user.supplier.bankcode}}</div>
      </a>
    </template>
    <a class="weui_cell" href="javascript:;" @click="$router.push({name: 'userinfo'})">
      <div class="weui_cell_bd weui_cell_primary">
        <p>会员资料完善</p>
      </div>
      <div class="weui_cell_ft hrf">
      </div>
    </a>
    <a class="weui_cell" href="javascript:;">
      <div class="weui_cell_bd weui_cell_primary">
        <p>客服电话</p>
      </div>
      <div class="weui_cell_ft">0474-8279367</div>
    </a>
    <a class="weui_cell" href="javascript:;" @click="$router.push({name: 'signin'})">
<!--    <a class="weui_cell" href="/weixin/WechatLogin!logout.action?rand=3">-->
      <div class="weui_cell_bd weui_cell_primary">
        <p>换绑用户</p>
      </div>
      <div class="weui_cell_ft hrf">
      </div>
    </a>
  </div>

  <div style="height: 60px; width: 100%;"></div>
    <div class="weui_tabbar" :style="{visibility: isReady}">
      <a href="javascript:;" @click="$router.push({path: '/index'})" class="weui_tabbar_item weui_bar_item_on">
        <div class="weui_tabbar_icon">
          <img src="@/assets/zhu_wechat.png" alt="">
        </div>
        <p class="weui_tabbar_label">首页</p>
      </a>
      <a href="javascript:;" @click="$router.push({path: '/common/TaskList'})" class="weui_tabbar_item" >
        <div class="weui_tabbar_icon task" id="wait" style="position: relative;">
          <img src="@/assets/task-wechat.png" alt="">
        </div>
        <p class="weui_tabbar_label">待办</p>
      </a>
      <!--      20230801注释-->
      <!--      <a :href="`http://${locationhost}/trace/TraceSource!index.action?fromConsole=false`" class="weui_tabbar_item">-->
      <!--        <div class="weui_tabbar_icon">-->
      <!--          <img src="@/assets/source_wechat.png" alt="">-->
      <!--        </div>-->
      <!--        <p class="weui_tabbar_label">植保</p>-->
      <!--      </a>-->
      <a href="javascript:;" @click="$router.push({path: '/mine'})" class="weui_tabbar_item">
        <div class="weui_tabbar_icon">
          <img src="@/assets/wd_wechat.png" alt="">
        </div>
        <p class="weui_tabbar_label">我</p>
      </a>
    </div>
  </div>
</template>

<script type="text/babel">
  export default {
    name: 'mine',
    data: () => ({
      user: '',
      isReady: false,
    }),
    components: {
    },
    created() {
      this.getUserInfo();
    },
    mounted() {
      this.isReady = true;
    },
    methods: {
      getUserInfo: function() {
        this.axios({
          method: 'get',
          url: '/prod-api/getUserInfo'
        }).then(response => {
          if (response.data.code == 200) {
            this.user = response.data.data;
          } else {
            this.toastText('用户过期，请重新登录');
            setTimeout(() => {
              this.$router.push({name: 'signin'});
            }, 1000)
          }
        });
      },
    }
  };
</script>
